/**
 * 跳转到指定url
 * @param url
 */
function redirect(url) {
		window.location.href = url;
}

/**
 * 修正主区域高尺寸
 */
function fixRightMainSize() {
	var browserHeight = $(window).height();
	$('#rightMain').css({height:browserHeight - 120 + 'px'});
}

/* 文档加载后  */
$(document).ready(function() {
	fixRightMainSize();
	
	$(window).resize(function() {
		fixRightMainSize();
	});
	
	/**
	 *  刷新验证码 
	 */
	$('#captcha-element img').click(function() {
		var refreshUrl = '/block/refresh-captcha';
		$.ajax({
			url:refreshUrl,
			cache:false,
			dataType:'json',
			type:'post',
			success:function(json) {
				$('#captcha-element #captcha-id').attr('value', json.id);
				$('#captcha-element img').attr('src', json.src);
			}
		});
	});
});